<template>
  <div class="app-container">
  <div class="filter-container">
        
        <el-input clearable v-model="search.number" placeholder="单号" style="width: 170px;margin-left:10px;"></el-input>
        <el-input clearable v-model="search.customer" placeholder="客户" style="width: 170px;margin-left:10px;"></el-input>
        <el-input clearable v-model="search.phone" placeholder="联系电话" style="width: 170px;margin:0 5px;"></el-input>
        <el-date-picker v-model="search.daterange" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
        </el-date-picker>

        <el-button type="primary" icon="el-icon-search" @click="searchClick()" style="margin-left:10px;">查询</el-button>
    </div>
    <el-table v-loading="listLoading" :data="list" 
      border fit highlight-current-row stripe 
      style="width: 100%">
      <el-table-column align="center" label="序" width="80">
        <template slot-scope="scope">
          <span>{{ scope.row._id }}</span>
        </template>
      </el-table-column>
     <el-table-column  min-width="100" align="center" label="意向单号">
        <template slot-scope="scope">
          <span>{{ scope.row.number }}</span>
        </template>
      </el-table-column>
      <el-table-column  min-width="100" align="center" label="客户姓名">
        <template slot-scope="scope">
          <span>{{ scope.row.customername }}</span>
        </template>
      </el-table-column>
      <el-table-column  min-width="100" align="center" label="联系电话">
        <template slot-scope="scope">
          <span>{{ scope.row.phone }}</span>
        </template>
      </el-table-column>
      <el-table-column  min-width="100" align="center" label="日期">
        <template slot-scope="scope">
          <span>{{ scope.row.intentiondate }}</span>
        </template>
      </el-table-column>
      <el-table-column  min-width="100" align="center" label="转意向天数">
        <template slot-scope="scope">
          <span>{{ scope.row.intentiondays }}</span>
        </template>
      </el-table-column>
      <el-table-column  min-width="100" align="center" label="已回访次数">
        <template slot-scope="scope">
          <span>{{ scope.row.revisittimes }}</span>
        </template>
      </el-table-column>
      <el-table-column  min-width="100" align="center" label="最近回访日期">
        <template slot-scope="scope">
          <span>{{ scope.row.recentvisitdate}}</span>
        </template>
      </el-table-column>
      <el-table-column  min-width="100" align="center" label="意向等级">
        <template slot-scope="scope">
          <span>{{ scope.row.intentionlevel }}</span>
        </template>
      </el-table-column>
      <el-table-column  min-width="100" align="center" label="是否战败">
        <template slot-scope="scope">
          <span>{{ scope.row.isfail }}</span>
        </template>
      </el-table-column>
      <el-table-column  min-width="100" align="center" label="逾期次数">
        <template slot-scope="scope">
          <span>{{ scope.row.overduetimes }}</span>
        </template>
      </el-table-column>
      <el-table-column  min-width="100" align="center" label="意向车型">
        <template slot-scope="scope">
          <span>{{ scope.row.intentioncar }}</span>
        </template>
      </el-table-column>
      <el-table-column  min-width="100" align="center" label="期望价格">
        <template slot-scope="scope">
          <span>{{ scope.row.intentionprice }}</span>
        </template>
      </el-table-column>
      <el-table-column  min-width="100" align="center" label="自店报价">
        <template slot-scope="scope">
          <span>{{ scope.row.shopprice }}</span>
        </template>
      </el-table-column>
      <el-table-column  min-width="100" align="center" label="销售顾问">
        <template slot-scope="scope">
          <span>{{ scope.row.guider }}</span>
        </template>
      </el-table-column>
      <el-table-column  min-width="100" align="center" label="今日应回访">
        <template slot-scope="scope">
          <el-tag :type="['info','success',''][scope.row.state]">{{ (scope.row.state?'是' : '否') }}</el-tag>
        </template>
      </el-table-column>
      <el-table-column  min-width="100" align="center" label="下次应访日期">
        <template slot-scope="scope">
          <span>{{ scope.row.nextvisitdate | parseTime('{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      
      <el-table-column align="center" label="操作"  width="380" fixed="right">
        <template slot-scope="scope">
          <el-button type="danger" size="small" @click="failClick(scope.row.id)">战败</el-button>
          <el-button type="primary" size="small" @click="modifyClick(scope.row.id)">修改</el-button>
          <el-button type="warning" size="small" @click="assignClick(scope.row.id)">分派</el-button>
          <el-button type="primary" size="small" @click="revisitClick(scope.row.id)">回访</el-button>
          
          <router-link :to="'/presalemanage/reception/intentiondetails/'+scope.row.id">
            <el-button type="primary" size="small" style="margin-left:5px;">
              详情
            </el-button>
          </router-link>
          
        </template>
      </el-table-column>
    </el-table>

    <pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.rows" @pagination="fetchData" />

  </div>
</template>

<script>
export default {
    data(){
        return{
            search:{
              number:'',
              customer:'',
              phone:'',
              daterange:'',
              nothavedorder:true
          },
          listQuery: {
                page: 1,
                rows: 20,
                name:'',
                phone:'',
                state:-1,
                daterange:''
            },
          list:null,
          listLoading:false,
          total:0,
        }
    },
    created(){
        
    },
    methods:{
        fetchData(){
            
        }
    }
}
</script>

<style>

</style>